package itsm.isperp.job;

import itsm.isperp.module.service.task.TskPlanTaskService;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 * 计划任务作业
 * 
 * @author lizx
 * @date 2013-7-31
 * 
 */
@Service
public class TskPlanTaskJob implements Job {

	public static final Logger logger = LoggerFactory
			.getLogger(TskPlanTaskJob.class);

	@Autowired
	protected TskPlanTaskService tskPlanTaskService;

	@Override
	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		logger.debug("generate plan task.");
		try {
			tskPlanTaskService.generateTask();
		} catch (Exception e) {
			logger.error("任务生产失败", e);
		}
	}
}
